﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en" style="height:100%">
<head>
    <meta charset="UTF-8">
    <title>Main</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="~/Scripts/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Scripts/bootstrap-3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
    <link href="~/Content/animate.min.css" rel="stylesheet" />
    <link href="~/Scripts/toastr-master/toastr.min.css" rel="stylesheet" />
    <link href="~/Content/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" />
    <link href="~/Content/Main.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-3.2.1.min.js"></script>
    <script src="~/Scripts/bootstrap-3.3.7/js/bootstrap.min.js"></script>
    <script src="~/Scripts/toastr-master/toastr.min.js"></script>
</head>
<body style="background-color: #F7F7F7;height:100%">
    <div>
        <!-- 侧边菜单 -->
        <div class="main-nav">
            <nav class="sidebar">
                <div class="sidebar-content">
                    <div class="brand">GALAXIS</div>
                    <ul class="sidebar-nav">
                        <li class="sidebar-header">
                        </li>
                        <li class="sidebar-item">
                            <a href="@Url.Action("StatisticsData","Statistics")" target="Main-Count" class="sidebar-link collapsed">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-layout align-middle"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg> <span class="align-middle">首页</span>
                            </a>
                        </li>
                        <li class="sidebar-item">
                            <a href="#ui1" data-toggle="collapse" class="sidebar-link collapsed">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-grid align-middle"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg> <span class="align-middle">仓库管理</span>
                            </a>
                            <ul id="ui1" class="sidebar-dropdown list-unstyled collapse ">
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("Rack","Statistics")" target="Main-Count">货架管理</a></li>
                            </ul>
                        </li>
                        <li class="sidebar-item">
                            <a href="#ui2" data-toggle="collapse" class="sidebar-link collapsed">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sliders align-middle">
                                    <line x1="4" y1="21" x2="4" y2="14"></line>
                                    <line x1="4" y1="10" x2="4" y2="3"></line>
                                    <line x1="12" y1="21" x2="12" y2="12"></line>
                                    <line x1="12" y1="8" x2="12" y2="3"></line>
                                    <line x1="20" y1="21" x2="20" y2="16">
                                    </line>
                                    <line x1="20" y1="12" x2="20" y2="3"></line>
                                    <line x1="1" y1="14" x2="7" y2="14"></line>
                                    <line x1="9" y1="8" x2="15" y2="8"></line>
                                    <line x1="17" y1="16" x2="23" y2="16"></line>
                                </svg> <span class="align-middle">设备操作</span>
                            </a>
                            <ul id="ui2" class="sidebar-dropdown list-unstyled collapse ">
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("AGVManagement","Equipment")" target="Main-Count">AGV管理</a></li>
                            </ul>
                        </li>
                        <li class="sidebar-item">
                            <a href="#ui3" data-toggle="collapse" class="sidebar-link collapsed">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-book-open align-middle"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>
                                <span class="align-middle">统计数据</span>
                            </a>
                            <ul id="ui3" class="sidebar-dropdown list-unstyled collapse ">
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("StatisticsData","Statistics")" target="Main-Count">运行统计</a></li>
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("RunningLog","Statistics")" target="Main-Count">运行日志</a></li>
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("TaskLog","Statistics")" target="Main-Count">任务日志</a></li>
                            </ul>
                        </li>
                        <li class="sidebar-item">
                            <a href="#ui4" data-toggle="collapse" class="sidebar-link collapsed">

                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-monitor align-middle">
                                    <rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
                                    <line x1="8" y1="21" x2="16" y2="21"></line>
                                    <line x1="12" y1="17" x2="12" y2="21"></line>
                                </svg>
                                <span class="align-middle">AGV系统</span>
                            </a>
                            <ul id="ui4" class="sidebar-dropdown list-unstyled collapse ">
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("AGVMonitoring","AGVSystem")" target="Main-Count">运行监控</a></li>
                                <li class="sidebar-item"><a class="sidebar-link" href="@Url.Action("QR_Code","AGVSystem")" target="Main-Count">二维码管理</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
            <div class="main-bottom-time">
                <div id="date" class="main-time"></div>
                <div id="time" class="main-time"></div>
            </div>
        </div>
        <!-- 侧边菜单end -->

        <div style="position:fixed;top:80px;left:0px;width:100%;background-color:white;" id="nav-top-phone" class="nav-phone">
            <ul class="sidebar-nav" style="margin-bottom:0px;">
                <li class="sidebar-item">
                    <a href="@Url.Action("StatisticsData","Statistics")" style="background-color:white;color:black;    border-bottom: 1px solid #D9DEE4;" target="Main-Count" class="sidebar-link collapsed">
                        <span class="align-middle" style="color:black">首页</span>
                    </a>
                </li>
                <li class="sidebar-item">
                    <a href="#ui5" data-toggle="collapse" class="sidebar-link collapsed" style="background-color:white;color:black;    border-bottom: 1px solid #D9DEE4;">
                       <span class="align-middle" style="color:black">仓库管理</span>
                    </a>
                    <ul id="ui5" class="sidebar-dropdown list-unstyled collapse ">
                        <li class="sidebar-item"><a class="sidebar-link" style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" href="@Url.Action("Rack","Statistics")" target="Main-Count">货架管理</a></li>
                    </ul>
                </li>
                <li class="sidebar-item">
                    <a href="#ui6" data-toggle="collapse" class="sidebar-link collapsed" style="background-color:white;color:black;    border-bottom: 1px solid #D9DEE4;">
                  <span class="align-middle" style="color:black">设备操作</span>
                    </a>
                    <ul id="ui6" class="sidebar-dropdown list-unstyled collapse ">
                        <li class="sidebar-item"><a style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" class="sidebar-link" href="@Url.Action("AGVManagement","Equipment")" target="Main-Count">AGV管理</a></li>
                    </ul>
                </li>
                <li class="sidebar-item">
                    <a href="#ui7" data-toggle="collapse" class="sidebar-link collapsed" style="background-color:white;color:black;border-bottom: 1px solid #D9DEE4;">
                   <span class="align-middle" style="color:black;">统计数据</span>
                    </a>
                    <ul id="ui7" class="sidebar-dropdown list-unstyled collapse ">
                        <li class="sidebar-item"><a style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" class="sidebar-link" href="@Url.Action("StatisticsData","Statistics")" target="Main-Count">运行统计</a></li>
                        <li class="sidebar-item"><a style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" class="sidebar-link" href="@Url.Action("RunningLog","Statistics")" target="Main-Count">运行日志</a></li>
                        <li class="sidebar-item"><a style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" class="sidebar-link" href="@Url.Action("TaskLog","Statistics")" target="Main-Count">任务日志</a></li>
                    </ul>
                </li>
                <li class="sidebar-item">
                    <a href="#ui8" data-toggle="collapse" class="sidebar-link collapsed" style="background-color:white;color:black;border-bottom: 1px solid #D9DEE4;">
                        <span class="align-middle" style="color:black">AGV系统</span>
                    </a>
                    <ul id="ui8" class="sidebar-dropdown list-unstyled collapse ">
                        <li class="sidebar-item"><a  style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" class="sidebar-link" href="@Url.Action("AGVMonitoring","AGVSystem")" target="Main-Count">运行监控</a></li>
                        <li class="sidebar-item"><a style="background-color:#f8f8f8;color:black;border-bottom: 1px solid #D9DEE4;" class="sidebar-link" href="@Url.Action("QR_Code","AGVSystem")" target="Main-Count">二维码管理</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <!-- 头部菜单 -->
        <div class="nav-bodys">
            <div class="main-top-nav" >
                <a class="menu_toggle"><i class="fa fa-navicon" style="font-size:35px;font-weight:bold"></i></a>
                <ul class="nav-ren">
                    <li style="position:relative;width:170px;float:right;display:block;">
                        <a href="javascript:;" style="text-decoration:none" data-toggle="dropdown" class="dropdown-toggle nav-left-top nav-left-top-text"><img class="main-user" src="~/image/user.png" />&nbsp;&nbsp;admin<b class="caret"></b></a>
                        <ul class="dropdown-menu" style="position:absolute;top:80px;left:0px;margin:0px;width:170px;">
                            <li><a href="@Url.Action("Index","Configuration")" target="Main-Count">系统配置</a></li>
                            <li class="divider"></li>
                            <li id="UpdatePwd"><a href="javascript:;">修改密码</a></li>
                            <li class="divider"></li>
                            <li>
                                <a href="/api/agvlogin/exit">
                                    退出系统<img style="float:right;width:14px;height:14px;margin-top:4px;" src="~/image/close.png" />
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li style="position:relative;width:80px;float:right;display:block;"><a href="#" class="nav-right-top"><img class="msg" src="~/image/msg.png" /></a></li>
                </ul>
                <div id="software-Name">GALAXIS AGV智能调度系统</div>
            </div>
        </div>
        <!-- 头部菜单end -->
        <!-- 内容 -->
        <div class="nav-bodys" style="min-width:230px;">
            @*<div class="main-counts" style="min-width:320px;">*@
                <iframe src="@Url.Action("StatisticsData","Statistics")" frameBorder=0 height="100%" width="100%" name="Main-Count" id="external-frame"></iframe>
            @*</div>*@
        </div>
        <!-- 内容end -->
    </div>
    <!-- 修改密码 -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">修改密码</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="txt_rolename">原密码</label>
                        <input type="password" name="agvNum" class="form-control" id="agvNum" placeholder="请输入原密码">
                        <input id="userId" class="form-control" type="hidden" value="<%=u_id %>" />
                    </div>
                    <div class="form-group">
                        <label for="txt_rolename">新密码</label>
                        <input type="password" name="agvSerialNum" class="form-control" id="userPassword" placeholder="请输入新密码">
                    </div>
                    <div class="form-group">
                        <label for="txt_defaulturl">确认密码</label>
                        <input type="password" name="agvIp" class="form-control" id="agvIp" placeholder="再次输入密码">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" id="btn_close" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
                    <button type="button" id="btn_submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
                </div>
            </div>
        </div>
    </div>

    <script>
        $('#btn_close').click(function () {
            $("#myModal").find(".form-control").val("");
        });
        //修改密码
        $('#btn_submit').click(function () {
            Addedit('/api/agvlogin/UserPass', $("#agvNum").val());
        });
        function password(url, pass) {
            if ($("userPassword").val() == $("agvIp").val()) {
                $.ajax({
                    type: 'post',
                    url: url,
                    contentType: 'application/json',
                    data: JSON.stringify({ "userId": $('#userId').val(), "userPassword": pass }),
                    datatype: 'json',
                    success: function (res) {
                        if (res.Success) {
                            //$('#myModal').modal('toggle'); //关闭Modal窗口
                            toastr.success(res.Message);
                        }
                        else {
                            toastr.error(res.Message);
                        }
                    },
                    error: function (e) {
                        toastr.error(e.responseText);
                    }
                });
            }
        }
        //修改密码
        function Addedit(url, pass) {
            $.ajax({
                type: 'post',
                url: url,
                contentType: 'application/json',
                data: JSON.stringify({ "userPassword": pass }),
                datatype: 'json',
                success: function (res) {
                    if (res.Success) {
                        password('/api/agvlogin/Password', $("#userPassword").val());
                        $('#myModal').modal('toggle'); //关闭Modal窗口
                    }
                    else {
                        toastr.error(res.Message);
                    }
                },
                error: function (e) {
                    toastr.error(e.responseText);
                }
            });
        }
        $(function () {
            $('#menu-nav').click(function () {
                $('.dropdown-menu').toggleClass('menu-open');
            });
            var sizetype = true;
            var sizetype1 = true;
            window.onresize = function () {
                $("#external-frame").height($(window).height() - 85);
            }
          
            //function mainSize()
            //{
            //    if ($(window).width() < 768) {
            //        if (sizetype) {
            //            $('.nav-bodys').toggleClass('nav-bodye');
            //            $('.main-nav').toggleClass('main-navs');
            //            sizetype = false;
            //        }
            //        sizetype1 = true;
            //    }
            //    if ($(window).width() > 768) {
            //        sizetype = true;
            //        if (sizetype1) {
            //            $('.nav-bodys').toggleClass('nav-bodye');
            //            $('.main-nav').toggleClass('main-navs');
            //            sizetype1 = false;
            //        }

            //    }
            //}

            $('.menu_toggle').click(function () {

                if ($(window).width() <= 768) {
                    $('#nav-top-phone').slideToggle('fast');
                } else {
                    $('.nav-bodys').toggleClass('nav-bodye');
                    $('.main-nav').toggleClass('main-navs');
                }


               
            });

            $("#external-frame").height($(window).height() - 85);
            $("[data-toggle='tooltip']").tooltip();

            CirculationTimes();

            setInterval(function () {
                CirculationTimes();
            }, 1000);
            setInterval(function () {
                msg();
            }, 1000);

            function CirculationTimes() {

                var year = new Date().getFullYear();
                var m = new Date().getMonth() + 1;
                var d = new Date().getDate();

                var hours = new Date().getHours();
                var minutes = new Date().getMinutes();
                var seconds = new Date().getSeconds();
                if (hours < 10) {
                    hours = '0' + hours;
                }
                if (minutes < 10) {
                    minutes = '0' + minutes;
                }
                if (seconds < 10) {
                    seconds = '0' + seconds;
                }
                $('#date').text("日期：" + year + "-" + m + "-" + d);
                $('#time').text("时间：" + hours + ":" + minutes + ":" + seconds);
            }

            function msg() {
                $('.msg').toggleClass('animated fadeIn');
            }

            $('#UpdatePwd').click(function () {

                $('#myModal').modal('toggle'); //关闭Modal窗口

            });


        });
    </script>
</body>
</html>